package it.stasbranger.myproject.domain;

import java.io.Serializable;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class SuppliersHasRequestsPK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public SuppliersHasRequestsPK() {
	}

	/**
	 */

	@Column(name = "suppliers_idsuppliers", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer suppliersIdsuppliers;
	/**
	 */

	@Column(name = "requests_idrequests", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer requestsIdrequests;

	/**
	 */
	public void setSuppliersIdsuppliers(Integer suppliersIdsuppliers) {
		this.suppliersIdsuppliers = suppliersIdsuppliers;
	}

	/**
	 */
	public Integer getSuppliersIdsuppliers() {
		return this.suppliersIdsuppliers;
	}

	/**
	 */
	public void setRequestsIdrequests(Integer requestsIdrequests) {
		this.requestsIdrequests = requestsIdrequests;
	}

	/**
	 */
	public Integer getRequestsIdrequests() {
		return this.requestsIdrequests;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((suppliersIdsuppliers == null) ? 0 : suppliersIdsuppliers.hashCode()));
		result = (int) (prime * result + ((requestsIdrequests == null) ? 0 : requestsIdrequests.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof SuppliersHasRequestsPK))
			return false;
		SuppliersHasRequestsPK equalCheck = (SuppliersHasRequestsPK) obj;
		if ((suppliersIdsuppliers == null && equalCheck.suppliersIdsuppliers != null) || (suppliersIdsuppliers != null && equalCheck.suppliersIdsuppliers == null))
			return false;
		if (suppliersIdsuppliers != null && !suppliersIdsuppliers.equals(equalCheck.suppliersIdsuppliers))
			return false;
		if ((requestsIdrequests == null && equalCheck.requestsIdrequests != null) || (requestsIdrequests != null && equalCheck.requestsIdrequests == null))
			return false;
		if (requestsIdrequests != null && !requestsIdrequests.equals(equalCheck.requestsIdrequests))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("SuppliersHasRequestsPK");
		sb.append(" suppliersIdsuppliers: ").append(getSuppliersIdsuppliers());
		sb.append(" requestsIdrequests: ").append(getRequestsIdrequests());
		return sb.toString();
	}
}
